angular.module('starter.services', ['ngResource'])

.factory('OrderService', ['$resource',
    function($resource){
        return $resource(apiPath+'/order.php?method=:method', {}, {
            getOrderList: {method:'GET', params:{method:'getOrderList'},isArray:false},
            getOrderDetail: {method:'GET', params:{method:'getOrderDetail'},isArray:false},
            driverConfirmOrder: {method:'GET', params:{method:'driverConfirmOrder'},isArray:false},
            disprocessOrder: {method:'GET', params:{method:'disprocessOrder'},isArray:false},
            getItemDetail: {method:'GET', params:{method:'getItemDetail'},isArray:false},
            setSubItem:{method:'GET', params:{method:'setSubItem'},isArray:false},
            setItemStatus:{method:'GET', params:{method:'setItemStatus'},isArray:false},
            completeOrder:{method:'GET', params:{method:'completeOrder'},isArray:false}

        });
    }])

.factory('UserService', ['$resource',
    function($resource){
        return $resource(apiPath+'/user.php', {}, {
            checkDriverUser: {method:'POST', params:{method:'checkDriverUser'},isArray:false}
        });
    }])

.factory('OrderStatusService', ['$resource',
    function($resource){
        return $resource(apiPath+'/mobile/order_status.php', {}, {
            changeOrderStatus: {method:'GET', params:{method:'changeOrderStatus'},isArray:false}
        });
    }])

;

